﻿window.onload = function() {

	document.getElementById("form").onsubmit = function() {
		var n = document.getElementById("n").value;
		if( isNaN(n) ) {
			alert("not a number!");
			return false;
		}
		if( n < 0 ) {
			alert("negative number!");
			return false;
		}
	};
};